Perfect James. Yeah, the new Schema have "taken care" of the data[@alias=' '], so that we now only have to type in the alias of the field to be used. I think it's a big step in the right direction.
By the way, remember to mark this post as solved if you find your answer solved :)
V4.5 XLST string(data [@alias='MenuName'])
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets"
exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">
<xsl:output method="xml" omit-xml-declaration="yes" />
<xsl:param name="currentPage"/>
<!-- Input the documenttype you want here -->
<xsl:variable name="level" select="1"/>
<xsl:template match="/">
<!-- The fun starts here -->
<ul>
<xsl:for-each select="$currentPage/ancestor-or-self::* [@level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']">
<li>
<pre>
<xsl:copy-of select="." />
</pre>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>- <xsl:value-of select="string(data [@alias='MenuName'])"/>
</a>
</li>
</xsl:for-each>
</ul>
</xsl:template>
</xsl:stylesheet>
Coming very unstuck in v4.5 when I import my scripts. Just created above off the template as a test case for string(data [@alias='MenuName'])
It does not return anything or a value.
Below is the using <xsl:copy-of select="." /> this is what it returns for node.
<pre><StandardMain id="1050" parentID="1047" level="2" writerID="0" creatorID="0" nodeType="1044" template="1045" sortOrder="2" createDate="2010-06-27T11:43:15" updateDate="2010-06-27T11:47:24" nodeName="Services" urlName="services" writerName="Administrator" creatorName="Administrator" path="-1,1047,1050" isDoc=""><PageTitle>Services</PageTitle><Body>
James, instead of data[@alias='MenuName'] I'm pretty sure that you can just use MenuName. Like this:
Does that make sense? If that doesn't work either, you could try putting a ./ in front of the MenuName. But the above should work in my head :)
/Kim A
Many thanks that works.
;) I must be using old methods to call stuff.
Cheers,
James
Perfect James. Yeah, the new Schema have "taken care" of the data[@alias=' '], so that we now only have to type in the alias of the field to be used. I think it's a big step in the right direction.
By the way, remember to mark this post as solved if you find your answer solved :)
/Kim A
is working on a reply...